package com.onpositive.realmview;

import java.beans.PropertyChangeListener;
import java.util.Map;
import java.util.Set;

import com.onpositive.commons.platform.registry.IAdaptable2;
import com.onpositive.realmview.model.ColumnConfiguration;
import com.onpositive.realmview.model.ICanDelete;
import com.onpositive.realmview.model.IHasViews;
import com.onpositive.realmview.model.ILabel;
import com.onpositive.realmview.model.IModelObject;
import com.onpositive.realmview.model.IViewGrouping;
import com.onpositive.realmview.model.IWorkingCopy;
import com.onpositive.realmview.model.IWorkingCopyOwner;
import com.onpositive.realmview.model.filtering.IBooleanFilter;
import com.onpositive.realmview.model.filtering.IUIFilter;
import com.onpositive.realmview.progress.IProgressMonitor;
import com.onpositive.semantic.model.realm.IModifiableRealm;
import com.onpositive.semantic.model.realm.IRealm;

public interface IRealmView extends INamedObject,IAdaptable2,IWorkingCopyOwner,IModelObject,ICanDelete{

	public static final String ENABLE_CELL_EDIT = "ENABLE_CELL_EDIT";
	public static final String LIST_MODE = "LIST_MODE";
	public static final String CURRENT_EXPANSION = "CURRENT_EXPANSION";
	public static final String COLUMN_ORDER = "COLUMN_ORDER";
	public static final String SORT_PROPERTY = "SORT_PROPERTY";
	public static final String SORT_ORDER = "SORT_ORDER";
	public static final String FOCUS_ON = "FOCUS ON";

	IViewGrouping getCurrentGrouping();

	void setCurrentGrouping(IViewGrouping grouping);
	
	IViewGrouping getSecondLevelGrouping();

	void setSecondLevelGrouping(IViewGrouping grouping);

	IModifiableRealm<IBooleanFilter> usedQuickFilters();
	
	IModifiableRealm<IUIFilter> filters();
	
	IModifiableRealm<ILabel> labels();
	
	IModifiableRealm<ILabel> summaries();

	IModifiableRealm<ColumnConfiguration> columns();

	IHasViews<?> getParent();

	IRealmView clone();

	void updateFrom(IRealmView original);

	boolean delete();

	Map<String, String> getSettings();

	IRealm<?> getRealm();

	Set<IUIFilter> removeStaleFilters();

	void addSettingListener(PropertyChangeListener ls);
	
	void removeSettingListener(PropertyChangeListener ls);
	
	public String put(String key, String value);
	
	IWorkingCopy copy(Object element);

	void commit(IProgressMonitor monitor,boolean locally);
	
	String getRealmDescription();

	Object copyIfExists(Object lastSegment);
	
	Object[] getContents();
}
